<h1>Edit Banner</h1>

<div class = "page">
  
</div>

<div class = "clear"></div>

<form method="post" action="<?php echo base_url(); ?>admin/banner/edit/process" class = "form" enctype="multipart/form-data">
  <input type = "hidden" name = "id" class = "input size2" value="<?php echo $info['id']; ?>" >
  <div class = "field">
    <label>Location</label>
    <select name="location" class = "input">
      <?php foreach ($banner_location as $v) { ?>
      <option value="<?php echo $v['id']; ?>" <?php echo $v['selected']; ?>><?php echo $v['position']; ?> : <?php echo $v['name']; ?></option>
      <?php } ?>
    </select>
  </div>
  <div class = "field"><label>Remark</label><input type = "text" name = "remark" class = "input size2" value="<?php echo $info['remark']; ?>" ></div>
  
  <div class = "field"><label>Start</label><input type = "text" name = "date_start" class = "input size1 datepicker" value="<?php echo $info['date_start']; ?>" /></div>
  <div class = "field"><label>Finish</label><input type = "text" name = "date_finish" class = "input size1 datepicker"  value="<?php echo $info['date_finish']; ?>" /></div>
  
  <div class = "field"><label>Image</label><input type = "file" name = "img" class = "input size1" >
  <div class = "field"><label></label><?php echo $info['img']; ?><input type = "hidden" name = "old_img" />
  <div class = "field"><label>Url</label><input type = "text" name = "url" class = "input size2" value="<?php echo $info['url']; ?>" /></div>
  
  <div class = "field">
    <label>Code</label>
    <textarea name = "code" class = "mceNoEditor"><?php echo $info['code']; ?></textarea>
    <div class = "clear"></div>
  </div>
  
  <div class = "field">
    <label></label>
    <input type = "radio" name = "used" class = "input" <?php echo $info['used_img']; ?> value="1" /> Use image
    <input type = "radio" name = "used" class = "input" <?php echo $info['used_code']; ?> value="2" /> Use code
  </div>
  <hr>
  <div class = "field"><label></label><input type = "submit" value = "Update" class = "btn">&nbsp;<a href = "#" class = "btn" onclick="javascript:history.back(1)">Cancel</a></div>
    <div class = "field error_msg"><label></label><?php echo $message; ?></div>
</form>

</div>

<style>
  .form label {
    width:80px;
  }
  textarea.mceNoEditor{
    width: 400px;    
    height: 150px;    
  }
</style>
<script>
  $(document).ready(function(){
    $('.datepicker').datepicker({
      dateFormat: 'yy-mm-dd',
      changeMonth: true,
      changeYear: true
    });
  });
</script>